package com.xiaofeng.pochi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopUser;
import com.xiaofeng.pochi.pojo.vo.ShopUserStatisticVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/08/21/21:44
 * @Description:
 */
@Component
public interface ShopUserMapper extends BaseMapper<ShopUser> {

    ShopUser getByOpenId(String username);

    /**
     * 保存
     * @param shopUser
     */
    void save(ShopUser shopUser);

    /**
     * 更新登录信息(手机号，密码)
     * */
    void updateLoginInfo(ShopUser shopUser);

    ShopUser getByPhone(String phone);

    /**
     * 根据id，物理删除用户
     * */
    void clearById(Long id);

    /**
     * 修改积分
     * @param user
     */
    void updatePoint(ShopUser user);

    /**
     * 分页查询
     * */
    List<ShopUser> getByPage(Page<ShopUser> page);

    /**
     * 查询分页总数
     * */
    Integer getCountByPage(Page<ShopUser> page);

    /**
     *根据id查询
     * */
    ShopUser get(Long id);

    /**
     * 根据id假删除
     * */
    void delete(Long id);

    void enableById(Long id);

    void disableById(Long id);


    /**
     * 根据id集合查询
     * */
    List<ShopUser> getByIds(List<Long> userIds);
}
